{% extends "base_sub.html" %}

{% block title %}{{ request.state.login_member.mb_nick }}尼姆的废料{% endblock title %}

{% block content %}
    <div id="scrap" class="new_win">
        <h1 id="win_title">{{ request.state.login_member.mb_nick }}尼姆的废料</h1>
        <ul class="p-0">
            {% for scrap in scraps %}
            <li class="position-relative p-4 main-bb main-font">
                <a href="{{ url_for('read_post', bo_table=scrap.bo_table, wr_id=scrap.wr_id) }}" class="scrap_tit fw-bold d-block fs-5 mb-3 main-font" target="_blank" onclick="open_parent_href(this.href); return false;">
                    {{ scrap.wr_subject|truncate(100, False, '...', 0) }}
                </a>
                <div class="d-flex">
                    <a href="{{ url_for('list_post', bo_table=scrap.bo_table) }}" class="scrap_cate bov-bg em-font p-1 rounded-2 fs-5 me-3" target="_blank" onclick="open_parent_href(this.href); return false;">
                    {{ scrap.bo_subject }}
                    </a>
                    <span class="scrap_datetime fs-5 sub-font">
                        <i class="fa fa-regular fa-clock" aria-hidden="true"></i>
                        {{ scrap.ms_datetime|datetime_format }}
                    </span>
                </div>
                <a href="{{ url_for('scrap_delete', ms_id=scrap.ms_id) }}?page={{ page }}" onclick="del(this.href); return false;" class="scrap_del"><i class="fa fa-regular fa-trash-can" aria-hidden="true"></i><span class="blind">删除</span></a>
            </li>
            {% else %}
            <li class="empty_li sub-font fs-4">无储存废料.</li>
            {% endfor %}
        </ul>

        {{ paging|safe }}
        
        <div class="win_btn">
            <button type="button" onclick="window.close();" class="btn_close">窗口关闭</button>
        </div>
    </div>
    <script>
        function open_parent_href(href) {
            opener.document.location.href = href;
            return false;
        }
    </script>
{% endblock content %}